package com.haiyuancloud.base.id.service.impl;

import com.baidu.fsg.uid.impl.CachedUidGenerator;
import com.haiyuancloud.base.id.service.BaseBaiduIdService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("com.haiyuancloud.base.id.service.BaseBaiduIdService")
public class BaseBaiduIdServiceImpl implements BaseBaiduIdService {

    @Resource
    private CachedUidGenerator uidGenerator;

    @Override
    public long getLongId() {
        return uidGenerator.getUID();
    }

    @Override
    public String getStringId() {
        return String.valueOf(this.getLongId());
    }
}
